<?php 
session_start();
include_once($_SERVER['DOCUMENT_ROOT'].'/public/func.php');
$config=include_once($_SERVER['DOCUMENT_ROOT'].'/public/config.php');
$pass=md5($_POST['pass']);
$_POST['pass']=$pass;
$name=$_POST['name'];
pub($config);
$sql="insert into users(name,pass) values('{$name}','{$pass}')";
$res=mysql_query($sql);
 if ($res===true&&!strcasecmp($_SESSION['yzm'], $_POST['yzm'])) {
 	$_SESSION['name']=$name;
 	// $_SESSION['pass']=$pass;
 	echo '<script>alert("注册成功");window.location.href="/home/index.php"</script>';
 }else{
 	echo '<script>alert("注册失败");window.location.href="/home/public/zhuche.php"</script>';
 }
?>